ostree: move flags into command struct, pass down through builtins
authorRuixin Bao <peter.bao@mail.utoronto.ca>
Tue, 17 Oct 2017 17:25:04 +0000 (17:25 +0000)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 20 Oct 2017 12:59:33 +0000 (12:59 +0000)
commit298c151fd8f78e6c3f6f199cd32981ae3d311828
tree596d088bc885b26d540d5bdb91ba89aa7b20c5b4
parent3c360a720ff1a8bf695365a79b3ac7975ffd25e8
ostree: move flags into command struct, pass down through builtins

This is a similar approach as
https://github.com/projectatomic/rpm-ostree/commit/12c34bb2491a07079c911ef26401fee939e5573c.

One thing to note is when we parse the admin related functions,
we still keep the old admin related flags, and added a new parameter
to represent the command struct.

This allows us to identify the caller of the function, making it
easier for us to possibly deduplicate the subcommand handling in
the future. A similar approach is done in rpm-ostree:
https://github.com/projectatomic/rpm-ostree/commit/83aeb018c1012c7a43783c09b74ec71bc9c45826

This also makes it easier for us to change the prototype of the function.
If we want to add something new in the future, we won't need to touch every prototype.

Closes: #1267
Approved by: cgwalters
58 files changed:
src/ostree/main.c
src/ostree/ot-admin-builtin-cleanup.c
src/ostree/ot-admin-builtin-deploy.c
src/ostree/ot-admin-builtin-diff.c
src/ostree/ot-admin-builtin-init-fs.c
src/ostree/ot-admin-builtin-instutil.c
src/ostree/ot-admin-builtin-os-init.c
src/ostree/ot-admin-builtin-set-origin.c
src/ostree/ot-admin-builtin-status.c
src/ostree/ot-admin-builtin-switch.c
src/ostree/ot-admin-builtin-undeploy.c
src/ostree/ot-admin-builtin-unlock.c
src/ostree/ot-admin-builtin-upgrade.c
src/ostree/ot-admin-builtins.h
src/ostree/ot-admin-instutil-builtin-grub2-generate.c
src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c
src/ostree/ot-admin-instutil-builtin-set-kargs.c
src/ostree/ot-admin-instutil-builtins.h
src/ostree/ot-builtin-admin.c
src/ostree/ot-builtin-cat.c
src/ostree/ot-builtin-checkout.c
src/ostree/ot-builtin-checksum.c
src/ostree/ot-builtin-commit.c
src/ostree/ot-builtin-config.c
src/ostree/ot-builtin-create-usb.c
src/ostree/ot-builtin-diff.c
src/ostree/ot-builtin-export.c
src/ostree/ot-builtin-find-remotes.c
src/ostree/ot-builtin-fsck.c
src/ostree/ot-builtin-gpg-sign.c
src/ostree/ot-builtin-init.c
src/ostree/ot-builtin-log.c
src/ostree/ot-builtin-ls.c
src/ostree/ot-builtin-prune.c
src/ostree/ot-builtin-pull-local.c
src/ostree/ot-builtin-pull.c
src/ostree/ot-builtin-refs.c
src/ostree/ot-builtin-remote.c
src/ostree/ot-builtin-reset.c
src/ostree/ot-builtin-rev-parse.c
src/ostree/ot-builtin-show.c
src/ostree/ot-builtin-static-delta.c
src/ostree/ot-builtin-summary.c
src/ostree/ot-builtin-trivial-httpd.c
src/ostree/ot-builtins.h
src/ostree/ot-main.c
src/ostree/ot-main.h
src/ostree/ot-remote-builtin-add-cookie.c
src/ostree/ot-remote-builtin-add.c
src/ostree/ot-remote-builtin-delete-cookie.c
src/ostree/ot-remote-builtin-delete.c
src/ostree/ot-remote-builtin-gpg-import.c
src/ostree/ot-remote-builtin-list-cookies.c
src/ostree/ot-remote-builtin-list.c
src/ostree/ot-remote-builtin-refs.c
src/ostree/ot-remote-builtin-show-url.c
src/ostree/ot-remote-builtin-summary.c
src/ostree/ot-remote-builtins.h